﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;

namespace ZhaoXi_Core_WebApi.Utility
{
    /// <summary>
    /// 
    /// </summary>
    public class CustomActionFilterAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            //就可以在这里添加配置支持跨域（在服务器端指定你允许跨域）
            Console.WriteLine($"方法过滤器CustomActionFilterAttribute的OnActionExecuting执行了，时间{DateTime.Now}");
        }
        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            Console.WriteLine($"方法过滤器CustomActionFilterAttribute的OnActionExecuted执行了，时间{DateTime.Now}");
        }
    }
}